import Vue from 'vue';
import Router from 'vue-router';
import routes from './routesConfig';


Vue.use(Router);
const router = new Router({
    routes
});
router.beforeEach((to, from, next)=>{
    if (to.path === '/Login') return next();
    let isLogin = window.sessionStorage.getItem("ADMIN")==null?false:true;
    console.log(isLogin,from.path)
    if(!isLogin) return next('/Login');
    next();


});

export default router;